package com.jar.exercise;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;

public class Demo {
    public static void main(String[] args) throws InterruptedException {
        List<Demo> list = new ArrayList<>();
        while (true) {
            TimeUnit.SECONDS.sleep(1);
            list.add(new Demo());
        }

    }

    public void test(String str) {

        char[] chars = str.toCharArray();
        Map<Character, Integer> charMap = new HashMap<>();
        for (char aChar : chars) {
            charMap.merge(aChar, 1, Integer::sum);
        }
        for (Map.Entry<Character, Integer> characterIntegerEntry : charMap.entrySet()) {
            System.out.println(characterIntegerEntry.getKey() + "::" + characterIntegerEntry.getValue());
        }
    }

    class Node {
        int value;
        Node next;

        public Node getNext() {
            return next;
        }

        public void setNext(Node next) {
            this.next = next;
        }

        public int getValue() {
            return value;
        }

        public void setValue(int value) {
            this.value = value;
        }
    }
}
